Skip to content

ERR: Fix GH13139: better error message on invalid pd.eval and df.query input #14473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

tserafim
Copy link
Contributor

Added test case to check for invalid input(empy string) on pd.eval('') and df.query('').
Used existing helper function(_check_expression)

@tserafim tserafim changed the title Fix GH13139: better error message on invalid pd.eval and df.query input ERR: Fix GH13139: better error message on invalid pd.eval and df.query input Oct 22, 2016
@codecov-io
Copy link

codecov-io commented Oct 22, 2016

Current coverage is 85.26% (diff: 100%)

Merging #14473 into master will increase coverage by <.01%

@@             master     #14473   diff @@
==========================================
  Files           140        140          
  Lines         50640      50641     +1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43175      43178     +3   
+ Misses         7465       7463     -2   
  Partials          0          0          

Powered by Codecov. Last update 170d13a...9a5c55f

Copy link
Contributor

@chris-b1 chris-b1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -57,3 +57,4 @@ Bug Fixes

- Bug in ``pd.pivot_table`` may raise ``TypeError`` or ``ValueError`` when ``index`` or ``columns``
is not scalar and ``values`` is not specified (:issue:`14380`)
- pd.eval('') and df.query('') now show better error message and raise ``ValueError`` (:issue: `13139`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more like

correctly raise ValueError on empty input to pd.eval() and df.query(). This

@@ -1891,6 +1891,17 @@ def test_bad_resolver_raises():
yield check_bad_resolver_raises, engine, parser


def check_empty_string_raises(engine, parser):
tm.skip_if_no_ne(engine)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the issue refernce in a comment

@jreback jreback added the Error Reporting Incorrect or improved errors from pandas label Oct 24, 2016
@jreback
Copy link
Contributor

jreback commented Oct 24, 2016

just a doc-comment. pls push ; ping when green.

@jreback jreback added this to the 0.19.1 milestone Oct 24, 2016
@jreback jreback closed this in 1308884 Oct 24, 2016
@jreback
Copy link
Contributor

jreback commented Oct 24, 2016

thanks!

jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this pull request Nov 2, 2016
… invalid pd.eval and df.query input

closes pandas-dev#13139

Added test case to check for invalid input(empy string) on pd.eval('')
and df.query('').  Used existing helper function(_check_expression)

Author: Thiago Serafim <[email protected]>

Closes pandas-dev#14473 from tserafim/issue#13139 and squashes the following commits:

77483dd [Thiago Serafim] ERR: correctly raise ValueError on empty input to pd.eval() and df.query() (pandas-dev#13139)
9a5c55f [Thiago Serafim] Fix GH13139: better error message on invalid pd.eval and df.query input

(cherry picked from commit 1308884)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERR: better error message on invalid .query input
4 participants